import React from 'react'
import {
    Form, message, Modal, Row, Col, Radio, Tabs, Select, DatePicker, Input, TimePicker, Button, Divider, Checkbox, Table
} from 'antd';
import './style/style.less';
import PatientCourse from './PatientCourse.jsx'

let userData = {}
class PatientCourseInfo extends React.Component {
    constructor(props) {
        super(props);
        userData = sessionStorage.userData ? JSON.parse(sessionStorage.userData) : {};
        this.state = {
            visible: false,//弹框显示状
            activeKey: 'PatientCourseInfo',
            admID:"",
        }
    }

    componentDidMount() {
        this.props.onRef(this);
    }

    showModal = (admID,patID) => {
        let that=this;
        this.setState({
            visible: true,
            admID:admID,
            patID:patID,
        },()=>{
            if(that.child){
                this.child.loadPatienCourse();
            }
        });
    };

    close = (e) => {
        this.setState({
            visible: false,
        });
    };
    onRef = (ref) => {
        this.child = ref;
    }

    render() {
        return (
            <Modal
                title="患者历程"
                className="PatientCourse"
                visible={this.state.visible}
                onCancel={this.close}
                footer={null} 
            >
               <PatientCourse onRef={this.onRef} admID={this.state.admID} patID={this.state.patID} ></PatientCourse>
            </Modal>
        )
    }
}
export default PatientCourseInfo